/*
 * @Author: WangLong
 * @Date: 2024-01-23 09:58:01
 * @LastEditTime: 2024-03-01 15:28:43
 * @LastEditors: WangLong
 * @Description:
 * @FilePath: \front_erp\src\api\system\dept.js
 */
import request from "@/utils/request";

// 查询部门列表
export function listDept(query) {
  return request({
    url: "/system/dept/list",
    method: "get",
    params: query,
  });
}

export function listDeptAll(query) {
  return request({
    url: "/system/dept/listAll",
    method: "get",
    params: query,
  });
}

// 查询部门列表（排除节点）
export function listDeptExcludeChild(deptId) {
  return request({
    url: "/system/dept/list/exclude/" + deptId,
    method: "get",
  });
}

// 查询部门详细
export function getDept(deptId) {
  return request({
    url: "/system/dept/" + deptId,
    method: "get",
  });
}
// 查询所属公司
export function selectCompanyByList() {
  return request({
    url: "/system/sysCompany/selectCompanyByList",
    method: "get",
  });
}
// 新增部门
export function addDept(data) {
  return request({
    url: "/system/dept",
    method: "post",
    data: data,
  });
}

// 修改部门
export function updateDept(data) {
  return request({
    url: "/system/dept/edit",
    method: "post",
    data: data,
  });
}

// 删除部门
export function delDept(deptId) {
  return request({
    url: "/system/dept/" + deptId,
    method: "post",
  });
}
